1. Field of the Invention
The present invention relates to an image processing apparatus that takes digital image data from outside the apparatus and processes and outputs the data, a control method, and a computer-readable medium storing a program.
2. Description of the Related Art
Image processing apparatuses that have become widely used in recent years, typical examples of which include copy machines and multifunction peripherals, have a high-resolution reading unit and a high-resolution recording unit in order to generate high quality images, and are capable of processing high resolution images. Accordingly, the amount of image data which must be processed by an image processing apparatus is becoming very large. Image processing apparatuses must store large amounts of image data, but it is difficult for them to do so because the amount of built-in memory they have is limited. In addition, even when an image processing apparatus attempts to perform high-speed processing, because the volume of data is large, a burden is imposed on the data bus of a circuit provided in the apparatus, which slows data transfer. Therefore, it is difficult to perform high-speed processing. In view of this, Japanese Patent Laid-Open No. 2008-42687 proposes a method for reducing the amount of data without lowering the image quality in cases of such a large amount of image data. According to the method disclosed in Japanese Patent Laid-Open No. 2008-42687, image data is divided into blocks, and classified into two groups based on the content of image data of each block, namely, a group of blocks that cause no problem even when the image quality is lowered and a group of blocks whose image quality must be maintained at high level. Then, the blocks that cause no problem even when the image quality is lowered are data-compressed using a compression factor or a compression scheme that provides a high compression rate but reduces image quality. In contrast, the blocks whose image quality needs to be maintained at high level are data-compressed using a compression factor or a compression scheme that provides a low compression rate but provides high image quality. That is, it has been proposed to reduce the size of image data while minimizing the lowering of image quality by changing the processing method for each type of block.
The above-described scheme in which image data is divided into blocks, the blocks are classified into high image quality blocks and low image quality blocks, and the compression method and compression rate factor are changed according to the type of blocks is very effective in data reduction. However, this scheme has the following problems. In the case where image processing that requires information regarding surrounding pixels of a pixel of interest, such as a dithering process or a filter process, is performed on a block, encoding compression data is used, and it is therefore necessary to perform a decompression process. For this reason, when image processing as described above is performed, it is necessary to perform the decompression process a number of times during the time between the input of image data and the storage of the data in a memory, and after image processing, a compression process needs to be performed again. Consequently, because compression and decompression are repeated, a long processing time is required, and thus it is not suitable for generating a high-speed data path. Conversely, it is also possible to conceive a scheme in which image data is not compressed during the time between the input of the image data to the storage of the image data in a memory, and data processing is performed on the raw image data. However, in this scheme, when an input image is data having a high quality and a high resolution, the data is streamed through a data bus between image processing modules, so a very heavy burden is imposed on the data bus. Accordingly, it is difficult even for this scheme to cope with a high-speed data path. This problem can be solved by, in the case of performing a compression process on each block, performing only a resolution reduction process without performing an encoding process. For example, a scheme can be used in which blocks are classified into two groups, namely, a group of blocks whose image quality can be lowered and a group of blocks whose image quality needs to be maintained at high level, and the blocks whose image quality can be lowered are subjected to a thinning out process in which image data is thinned out to half in the vertical and horizontal directions. Because only resolution is reduced, images that have undergone resolution reduction are raw image data, and it is therefore possible to perform image processing as described above such as a dithering process or a filter process.
However, this technique has a problem as well. The problem is that it is not possible to compress image data in which blocks having different resolutions are mixed by using a typical encoding scheme. The ordinary encoding scheme works when all the pixels of an image have the same weight. It is therefore not possible to simply perform image encoding when blocks/pixels having different resolutions are mixed in one image data piece as described above.